﻿@using WorkFlow.Data
@inject CommentTool commentTool
<div class="top-row pl-4 navbar navbar-dark">
    <a class="navbar-brand" href="">WorkFlow</a>
    <button class="navbar-toggler" @onclick="ToggleNavMenu">
        <span class="navbar-toggler-icon"></span>
    </button>
</div>

<div>
    <ul class="nav flex-column" @onclick="ToggleNavMenu">
        <li class="nav-item px-3">
            <NavLink class="nav-link" href="" Match="NavLinkMatch.All">
                <span class="oi oi-home" aria-hidden="true"></span> Home
            </NavLink>
        </li>
        <li class="nav-item px-3">
            <NavLink class="nav-link" href="Rule">
                <span class="oi oi-plus" aria-hidden="true"></span> Rule
            </NavLink>
        </li>
        <li class="nav-item px-3">
            <NavLink class="nav-link" href="Scheduled_Tasks">
                <span class="oi oi-plus" aria-hidden="true"></span> Scheduled Tasks
            </NavLink>
        </li>
        <li class="nav-item px-3">
            <NavLink class="nav-link" href="UpdateCompany">
                <span class="oi oi-plus" aria-hidden="true"></span> UpdateCompany
            </NavLink>
        </li>
        <li class="nav-item px-3">
            <NavLink class="nav-link" href="WorkFlowFile">
                <span class="oi oi-plus" aria-hidden="true"></span> WorkFlowFile
            </NavLink>
        </li>
        <li class="nav-item px-3">
            <NavLink class="nav-link" href="Helper">
                <span class="oi oi-list-rich" aria-hidden="true"></span> Helper
            </NavLink>
        </li>
    </ul>
</div>

@code {
    private bool collapseNavMenu = true;

    private string NavMenuCssClass => collapseNavMenu ? "collapse" : null;

    private void ToggleNavMenu()
    {
        commentTool.ShowNav = true;
        collapseNavMenu = !collapseNavMenu;
    }
}
